#include<stdio.h>
#include<string.h>

void dao(char* left,char* right)
{
	char ch=0;
	while(left<right)
	{
		ch=*left;
		*left=*right;
		*right=ch;
		left++;
		right--;
	}
}

int main()
{
	char arr[101]={0};
	gets(arr);
	char* left=arr,*right=arr+strlen(arr)-1;
	dao(left,right);
	char * i=arr,*j=arr;
	while((*i)!='\0')
	{
		while(*j!=' '&&*j!='\0')
		{
			j++;
		}
		dao(i,j-1);
		while(*j==' ')
			j++;
		i=j+1;
	}
	printf("%s\n",arr);
	return 0;
}
